import java.io.PrintStream;
import java.util.Scanner;

public class task04
{

    public task04()
    {
    }

    public static void main(String args[])
    {
        String id = null;
        Scanner input = new Scanner(System.in);
        System.out.println("\u8BF7\u8F93\u5165\u60A8\u7684\u8EAB\u4EFD\u8BC1:");
        id = input.next();
        String idlocation = id.substring(0, 6);
        String idbirth = id.substring(6, 14);
        String idmath = id.substring(14, 17);
        idlocation = shuzu(idlocation);
        String idnian = idbirth.substring(0, 4);
        String idyue = idbirth.substring(4, 6);
        String idri = idbirth.substring(6, 8);
        int d = Integer.parseInt(idmath);
        String gender = null;
        if(d % 2 == 0)
            gender = "\u5973";
        else
            gender = "\u7537";
        System.out.println("\u60A8\u7684\u7701\u4EFD\u662F\uFF1A" + idlocation + "\n\u60A8\u7684\u751F\u65E5\u662F:" + idnian + "\u5E74" + idyue + "\u6708" + idri + "\u65E5" + "\n\u60A8\u7684\u6027\u522B:" + gender);
        input.close();
    }

    public static String shuzu(String idlocation)
    {
        String a = idlocation.substring(0, 1);
        String b = idlocation.substring(1, 2);
        int c = Integer.parseInt(a);
        int d = Integer.parseInt(b);
        String shuzu[][] = {
            new String[0], {
                "", "\u5317\u4EAC\u5E02", "\u5929\u6D25\u5E02", "\u6CB3\u5317\u7701", "\u5C71\u897F\u7701", "\u5185\u8499\u53E4\u81EA\u6CBB\u533A"
            }, {
                "", "\u8FBD\u5B81\u7701", "\u5409\u6797\u7701", "\u9ED1\u9F99\u6C5F\u7701"
            }, {
                "", "\u4E0A\u6D77\u5E02", "\u6C5F\u82CF\u7701", "\u6D59\u6C5F\u7701", "\u5B89\u5FBD\u7701", "\u798F\u5EFA\u7701", "\u6C5F\u897F\u7701", "\u5C71\u4E1C\u7701"
            }, {
                "", "\u6CB3\u5357\u7701", "\u6E56\u5317\u7701", "\u6E56\u5357\u7701", "\u5E7F\u4E1C\u7701", "\u5E7F\u897F\u58EE\u65CF\u81EA\u6CBB\u533A", "\u6D77\u5357\u7701"
            }, {
                "", "\u91CD\u5E86\u5E02", "\u56DB\u5DDD\u7701", "\u8D35\u5DDE\u7701", "\u4E91\u5357\u7701", "\u897F\u85CF\u81EA\u6CBB\u533A"
            }, {
                "", "\u9655\u897F\u7701", "\u7518\u8083\u7701", "\u9752\u6D77\u7701", "\u5B81\u590F\u56DE\u65CF\u81EA\u6CBB\u533A", "\u65B0\u7586\u7EF4\u543E\u5C14\u81EA\u6CBB\u533A"
            }
        };
        idlocation = shuzu[c][d];
        return idlocation;
    }
}
